RM.Pages.Functions.HospitalityPrices_ReservationEdit = function(UnitID, FormID, data){

    // define the otherinfo values.
    // this is used to tell the system which otherinfo we need to handle.
    if (!RM.Common.InArray('board_type',RM.Pages.Reservations_Edit_OtherInfo)){
        //InArray is use so this is not added more than once.
        RM.Pages.Reservations_Edit_OtherInfo.push('board_type');
    }

    var boardTypeValue = "";

    if (data.board_type !== ""){
        boardTypeValue = eval("RM.Translate.Admin.HospitalityPrices.BoardTypes."+data.board_type);
    }

    return new Ext.form.FieldSet({
        id: FormID+'fieldset',
        bodyStyle : "padding:10px;",
        layout: 'border',
        labelWidth: 190,
        title: RM.Translate.Admin.Reservations.Edit.PersonsSelectionTitle,
        height: 150,
        items:[{
            region:'west',
            width: 200,
            collapsible: false,
            layout: 'form',
            bodyBorder: false,
            frame: false,
            items : [{
                id : FormID+"persons_adults",
                hiddenName : FormID+"persons_adults_hidden",
                name : FormID+"persons_name",
                xtype : "combo",
                width: 60,
                fieldLabel : RM.Translate.Admin.Reservations.Edit.Adults,
                store : new Ext.data.SimpleStore({
                    fields:[
                    {
                        name:'value',
                        type:'string'
                    },

                    {
                        name:'text',
                        type:'string'
                    }
                    ],
                    data: RM.Common.Combo_Number_Data(1,20,1)
                }),
                forceSelection: true,
                mode: "local",
                triggerAction: 'all',
                selectOnFocus: true,
                valueField: 'value',
                displayField: 'text',
                allowBlank: false,
                emptyText: RM.Translate.Common.PleaseSelect,
                value: data.persons.adults,
                listeners: {
                    'change': function(){
                        RM.Pages.Functions.Reservations_SummaryUpdate(UnitID)
                    }
                }
            },{
                id : FormID+"persons_children",
                hiddenName : FormID+"persons_hidden",
                name : FormID+"persons_name",
                xtype : "combo",
                width: 60,
                fieldLabel : RM.Translate.Admin.Reservations.Edit.Children,
                store : new Ext.data.SimpleStore({
                    fields:[
                    {
                        name:'value',
                        type:'string'
                    },

                    {
                        name:'text',
                        type:'string'
                    }
                    ],
                    data: RM.Common.Combo_Number_Data(0,20,1)
                }),
                forceSelection: true,
                mode: "local",
                triggerAction: 'all',
                selectOnFocus: true,
                valueField: 'value',
                displayField: 'text',
                allowBlank: false,
                emptyText: RM.Translate.Common.PleaseSelect,
                value: data.persons.children,
                listeners: {
                    'change': function(){
                        RM.Pages.Functions.Reservations_SummaryUpdate(UnitID)
                    }
                }
            },{
                id : FormID+"persons_infants",
                hiddenName : FormID+"persons_hidden",
                name : FormID+"persons_name",
                xtype : "combo",
                width: 60,
                fieldLabel : RM.Translate.Admin.Reservations.Edit.Infants,
                store : new Ext.data.SimpleStore({
                    fields:[
                    {
                        name:'value',
                        type:'string'
                    },

                    {
                        name:'text',
                        type:'string'
                    }
                    ],
                    data: RM.Common.Combo_Number_Data(0,6,1)
                }),
                forceSelection: true,
                mode: "local",
                triggerAction: 'all',
                selectOnFocus: true,
                valueField: 'value',
                displayField: 'text',
                allowBlank: false,
                emptyText: RM.Translate.Common.PleaseSelect,
                value: data.persons.infants,
                listeners: {
                    'change': function(){
                        RM.Pages.Functions.Reservations_SummaryUpdate(UnitID)
                    }
                }
            }]
        },{
            region:'center',
            autoScroll:true,
            layout: 'form',
            bodyBorder: false,
            frame: false,
            items:[{
                id : FormID+"otherInfo[board_type]",
                hiddenName : FormID+"otherInfo[board_type]",
                name : FormID+"otherInfo[board_type]",
                xtype : "combo",
                width: 150,
                fieldLabel : RM.Translate.Admin.HospitalityPrices.ReservationEdit.BoardType,
                forceSelection: true,
                triggerAction: 'all',
                selectOnFocus: true,
                valueField: 'value',
                displayField: 'text',
                allowBlank: false,
                emptyText: RM.Translate.Common.PleaseSelect,
                value: boardTypeValue,
                store: new Ext.data.JsonStore({
                    fields:[
                        {name:'value', type:'string'},
                        {name:'text', type:'string'}
                    ],
                    url : RM.Common.AssembleURL({
                        controller: 'HospitalityPrices',
                        action: 'getboardtypeJson',
                        parameters:[{
                            name: "unit_id",
                            value: UnitID
                        },{
                            name: "startdate",
                            value: data.reserved_period.start_date
                        },{
                            name: "enddate",
                            value: data.reserved_period.end_date
                        }]
                    })
                }),
                listeners: {
                    'change': function(){
                        RM.Pages.Functions.Reservations_SummaryUpdate(UnitID)
                    }
                }
            }]
        }]
    });

}